<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
	<title>Document</title>
	<script src="./js/react.min.js.back"></script>
	<script src="./js/react-dom.min.js.back"></script>
	<script src="./js/babel.min.js.back"></script>
</head>
<body>
	<div id="example">
		
	</div>
</body>
<script type="text/babel">
	{/*

	*/}

	var Hello = React.createClass({
	  getInitialState: function () {
	    return {
	      opacity: 1.0
	    };
	  },
		{/* 当页面加载后运行 */}
	  componentDidMount: function () {
	    this.timer = setInterval(function () {
	      var opacity = this.state.opacity;
	      opacity -= .05;
	      if (opacity < 0.1) {
	        opacity = 1.0;
	      }
	      this.setState({
	        opacity: opacity
	      });
	    }.bind(this), 100);
	  },

	  render: function () {
	    return (
	      <div style={{opacity: this.state.opacity}}>
	        Hello {this.props.name}
	      </div>
	    );
	  }
	});

	ReactDOM.render(
	  <Hello name="world"/>,
	  document.getElementById('example')
	);
</script>

</html>
